Skip to content

fix(macos): connect the runner process to the window server before XCTest events - #4155

Merged
thymikee merged 1 commit into
mainfrom
maint/4142-macos-runner-window-server
Nov 2, 2026
Merged

thymikee merged 1 commit into
mainfrom
maint/4142-macos-runner-window-server

Conversation

@thymikee

@thymikee thymikee commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

With Xcode 27.2 the macOS runner aborts in CGS_REQUIRE_INIT on the first synthesized event (click, tap, fill, scroll). The UI-test runner never touches NSApplication, so the process is not connected to the window server when XCTest reaches SLSGetDisplaysWithRect. RunnerTests now touches NSApplication.shared in a macOS-only class setUp, the fix the reporter ran locally.

1 file. No source-text test: no existing guard asserts runner Swift content, so a text pin would be a new pattern. Fixes #4142

Validation

  • The crash itself is not reproduced here: the host has Xcode 27.1. The reporter verified the fix on Xcode 27.2 (click, fill, scroll on Brave, no assert).
  • Compiles: pnpm build:xcuitest:macos.
  • Live on the macOS host with this branch's runner, TextEdit via --platform macos: click, fill ("Filled 10 chars", text visible in the document) and scroll down all succeeded. A stray system "PosterBoard quit unexpectedly" dialog was on the desktop, so the 27.1 run does not prove the 27.2 fix.
  • pnpm check:affected --run --head 6fc856b486: passed, exactCommit=true.
  • CI: the Apple macOS lane builds and runs the runner.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

…Test events

Xcode 27.2 aborts in CGS_REQUIRE_INIT on the first synthesized event because the
UI-test runner never touches NSApplication. Touch NSApplication.shared in the
RunnerTests class setUp on macOS.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agent-device-website Ready Ready Preview Nov 2, 2026 7:35am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.66 MB 5.66 MB +136 B
Package (unpacked) 5.66 MB 5.66 MB +136 B
Package (download) 1.72 MB 1.72 MB +34 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.9 ms 27.1 ms -1.8 ms
CLI --help 57.2 ms 57.5 ms +0.3 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

No findings. round 1 added 2 new fingerprints (<= 2).

Reply under an inline comment with @apex-sentinel-staging note ... or @apex-sentinel-staging pivot ... to re-check that finding.
Comment @apex-sentinel-staging review on this conversation to run a full review.

@thymikee

thymikee commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

The code looks good at 6fc856b: the change in RunnerTests.swift is #if os(macOS)-only, matches the reporter's patch from #4142, and I found nothing to fix. Not blocking, and you can take or leave it: no run here, local or CI, executes the runner on Xcode 27.2, which is the only version that asserts, so please ask the #4142 reporter to confirm on 27.2 with a runner built from this head (or the next release) and close the issue only after that. The Smoke Tests failure looks unrelated: the iOS simulator smoke:capture-close step timed out when xcrun swiftc built the video validator, the other iOS tests passed, and the macOS phase had no failures. I could only check one attempt, so a green rerun at 6fc856b is needed before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 2, 2026
@thymikee
thymikee merged commit a0e7c7d into main Nov 2, 2026
19 of 21 checks passed
@thymikee
thymikee deleted the maint/4142-macos-runner-window-server branch November 2, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS runner aborts in CGS_REQUIRE_INIT on the first synthesized event with Xcode 27.2 (XCTDisplayInterface → SLSGetDisplaysWithRect)

1 participant